package com.jcw.controller;

import com.jcw.common.R;
import com.jcw.domain.User;
import com.jcw.service.UserService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/sendMsg")
    public R<String> sendMsg(@RequestBody User user){
        return userService.sendMsg(user);
    }

    @PostMapping("/login")
    public R<String> login(@RequestBody Map map){
        return userService.login(map);
    }

    @PostMapping("/loginout")
    public R<String> loginout(){
        return userService.loginout();
    }

}
